<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width= , initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button>按钮1</button>
        <button></button>
        <button></button>
        <button></button>
        <button></button>
    </div>
    <script src="../js/vue.js"></script>
    <script>
        // 这集的重点是  $event
         const app = new Vue({
            el: '#app',    
            data: {    
                counter: 0  
            },
            data: obj,
            methods: {
                // es6的写法
                add() {
                    console.log("add被执行");
                    this.counter++;
                },
                sub() {
                    console.log("sub被执行");
                    this.counter--;
                }
            }
        })
    </script>
</body>
</html>